package tech.tongyu.bct.service.impl;

import lombok.extern.slf4j.Slf4j;
import tech.tongyu.bct.service.TestCacheService;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * @author summit
 * @since 2021/7/16 13:34
 */
@Slf4j
@Service
public class CacheServiceImpl implements TestCacheService {

	@CacheEvict(cacheNames = "test",key = "#name")
	@Override
	public void add(String name) {
		log.info("新增了，看是否清除缓存");
	}

	@Cacheable(cacheNames = "test",key = "#name")
	@Override
	public String set(String name) {

		return "sss";
	}
}
